/*
 * *****************************************************************************************
 *
 * 		Copyright (C) 2014-2019 Gowin Semiconductor Technology Co.,Ltd.
 * 		
 * @file			main.c
 * @author		Embedded Development Team
 * @version		V1.0.0
 * @date			2019-10-1 09:00:00
 * @brief			Main function.
 ******************************************************************************************
 */

/* Includes ------------------------------------------------------------------*/
#include "gw1ns4c.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>

int main()
{ 
  NVIC_InitTypeDef InitTypeDef_NVIC;
	
  SystemInit();	//system init
	
  //Enable RTC interrupt
  InitTypeDef_NVIC.NVIC_IRQChannel = RTC_IRQn;
  InitTypeDef_NVIC.NVIC_IRQChannelPreemptionPriority = 1;
  InitTypeDef_NVIC.NVIC_IRQChannelSubPriority = 1;
  InitTypeDef_NVIC.NVIC_IRQChannelCmd = ENABLE;
  NVIC_Init(&InitTypeDef_NVIC);
	
  GPIO0->OUTENSET = 0xFFFFFFFF;
  GPIO0->DATA = 0xFFFFFFFF;

  RTC_init();// rtc init
	
  while(1);
}

//RTC Interrupt handler --> gw1ns4c_it.c
